package com.juphoon.oauth.core.controller;

import com.juphoon.oauth.core.entity.ServerResponse;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;

@RequestMapping("/loginPage")
@Controller
public class BasicLoginController {


    @RequestMapping(produces = "text/html")
    public String loginHtml() {
        return "login.html";
    }

    @ResponseBody
    @RequestMapping
    @ResponseStatus(code = HttpStatus.UNAUTHORIZED)
    public ServerResponse login() {
        return ServerResponse.ERROR("未登录");
    }

}
